﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace __moov
{
    public partial class frmWelcome : Form
    {
        // This block is used to animate the window
        public const int AW_ACTIVATE = 0x20000;
        public const int AW_HIDE = 0x10000;
        public const int AW_BLEND = 0x80000;
        public const int AW_CENTER = 0x00000010;
        public const int AW_SLIDE = 0X40000;
        public const int AW_HOR_POSITIVE = 0x1;
        public const int AW_HOR_NEGATIVE = 0X2;
        public const int AW_VER_POSITIVE = 0x00000004;
        public const int AW_VER_NEGATIVE = 0x00000008;

        public bool animateForm = true;
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern int AnimateWindow(IntPtr hwand, int dwTime, int dwFlags);
        // -------------------------------------------------------//

        public frmWelcome()
        {
            InitializeComponent();

            this.SetDesktopLocation(Screen.PrimaryScreen.WorkingArea.Right - this.Width,
              Screen.PrimaryScreen.WorkingArea.Bottom - this.Height);
        }

        private void envFrmLoad(object sender, EventArgs e)
        {
            //Performs window animation
            if (animateForm) AnimateWindow(this.Handle, 500, AW_ACTIVATE | AW_SLIDE | AW_VER_NEGATIVE);

        }


        private void envBtnSettingClick(object sender, EventArgs e)
        {
            //display the settings form
            FrmSettings frmSettings = new FrmSettings();
            frmSettings.ShowDialog();

        }

        private void envBtnCloseClick(object sender, EventArgs e)
        {
            AnimateWindow(this.Handle, 500, AW_ACTIVATE | AW_SLIDE | AW_VER_POSITIVE | AW_HIDE);
            this.Close();
        }
    }
}
